﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configers
{
    public class CFFKConfigers : IEntityTypeConfiguration<CFFK>
    {
        public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<CFFK> builder)
        {
            builder.ToTable(nameof(CFFK));
            builder.Property(x => x.FirstKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.FirstKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.FirstKindSalaryId).IsRequired(false);
            builder.Property(x => x.FirstKindSaleId).IsRequired(false);

            builder.HasData(new CFFK()
            {
                FfkId = 1,
                FirstKindId = "01",
                FirstKindName = "集团",
                FirstKindSalaryId = "1",
                FirstKindSaleId = "1"
            }
            );
        }
    }
}
